home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AOL File Library: 2,801 to 2,900
/
aol-file-protocol-4400-2801-to-2900.zip
/
AOLDLs
/
TAWUG
/
TAWUG Disk No. 53 (SHK)
/
TAWUG53.shk
/
APW.FILE.FORMAT
(
.txt
)
next >
Wrap
AppleWorks Document
|
1987-06-29
|
31KB
|
562 lines
O=====|====|====|====|====|====|====|====|====|====|====|====|====|====|====|===
LThe following information is from "Scarlett," December, 1985, a publication O
Mof the Big Red Apple Club, 1105 S. 13th St., #102, Norfolk, NE 68701. Their *
source of this information is not known.
AppleWorks File Formats
NThis document describes the file formats for AppleWorks and /// E-Z Pieces as I
Gof 2/3/84. This is not confidential information, and may be copied as
necessary.
KPLEASE!!! At the request of the product manager... If you receive requests M
Kfor this info from a developer, please let us know who, what for, etc., so O
Mthat we can inform the product manager. The reason for this request is that O
Mthe product manager is very interested in marketing this product, and if fun L
Jthings are being done with the files, he'd like to know about it so maybe K
Ithey could get together on the product. Thanks for your support in this
matter.
JThis document may be revised from time to time to correct errors, clarify B
ambiguous definitions, or to report changes in the file formats.
Definitions
LLSB: The least significant byte of a word. It is also the "left byte," E
Cthe "first byte off the disk," and the "lower address in memory." >
As you can see, we're going to try to explain our buzzwords.
NMSB: The most significant byte of a word. Its address will be one higher E
Cthan the address of the LSB, in memory, and on disk. If the total <
value of a word is less than 256D, this byte will be zero.
MRL: Data base multiple record layout.
SRL: Data base single record layout.
RAC: Review/Add/Change screen.
N1W: Shorthand for "one word." You will also see references to bytes, in
the form "3B," for example.
N1BI: One byte integer. Values from 0 to 255 decimal. A value of decimal
50 will be stored as 32H.
K1WI: One word integer. Bit 80 of the LSB has a value of 128 decimal. G
EBit 80 of the MSB is the sign bit. Bit 01 of the MSB has a value of
256 decimal.
Boolean: A single byte that has 0H (false) or 1H (true).
NString: A 1BI followed by the number of characters shown in the value of the
ProDOS: All references to ProDOS apply equally to SOS.
DB: AppleWorks and/or /// E-Z Pieces Data Base.
SS: AppleWorks and/or /// E-Z Pieces Spreadsheet.
WP: AppleWorks and/or /// E-Z Pieces Word Processor.
AW: AppleWorks and/or /// E-Z Pieces.
IBit 80: All bits are referred to by their hexadecimal value. 80 is the .
leftmost bit in a byte, 01 is the rightmost.
L"+" All addresses within an area will be relative to the first byte of F
Dthe area. For example, the first byte of the area will be referred 4
to as "Byte +0," the 10th byte would be "Byte +9."
MHex/dec: All hexadecimal numbers will be shown with a trailing H as in 1CH. E
CDecimal numbers may sometimes be shown with a trailing D. Numbers "
without a D or an H are decimal.
Disk Directory Information
You may wish to refer to Apple's SOS Reference Manual, Volume 1, page 100.
Three file types are reserved for AW files:
File type 19H Data Base
File type 1AH Word Processor
File type 1BH Spreadsheet
LThe volume/subdirectory auxiliary type word (+1FH) is used by AW to control K
Iupper/lower case display of file names. Bit 80 of the LSB refers to the I
Gfirst character of the file name, bit 02 of the MSB refers to the 15th
character, and so on.
AW performs the following steps when it saves one of its files to disk:
1. Zero all 16 bits of the auxiliary type word.
L2. Examine the file name for lower case letters. If one is found, change E
Cto "1" the corresponding bit in auxiliary type word and change the
letter to upper case.
K3. Examine the file name for spaces. If a space is found, change to "1" G
Ethe corresponding bit auxiliary type word, and change the space to a
period.
LWhen files are read from disk, the file name and auxiliary type information P
Nfrom the directory "file entry" are used to determine which characters should A
be lower case, and which periods should be displayed as spaces.
KIf you use the auxiliary type bytes for a different purpose, AW will still P
Ndisplay the file names, but it is likely that the wrong letters will be lower
case.
Data Base Files
KData Base files start with a variable length header, followed by 600 bytes J
Hfor each report format (if any), the "standard values" record, and then 0
variable length information for each "record."
KThe header contains category names, record selection rules, counts, screen P
Npositioning information and all other information that is not specific to one
record.
L+000 - +001 1W1 that is the number of bytes in the remainder of the header B
record. Use this count for your next ProDOS read from the disk.
+002 - +029 Ignore these bytes.
K+030 Cursor direction when Return is pressed in SRL. 1H: Order in =
;which you defined categories, or 2H: Left to right, top to
bottom.
N+031 What direction should the cursor go when you press Return in the
MRL? D)own or R)ight.
+032 - +033 Ignore these bytes.
M+034 Style of display that Review/Add/Change was using when the file
was saved: R: SRL. /: MRL.
+035 1BI Number of categories per record. Values from 01H to 1EH.
+036 - +037 1WI Number of records in file.
+038 1BI number of reports in this file, maximum of 8.
+039 - +041 Ignore these bytes.
L+042 - +071 1BI for each of up to 30 columns, showing the number of spaces @
>used for this column on the MRL. Be sure that you understand B
@that categories may have been rearranged on the MRL. Byte +042 +
refers to the leftmost column on the MRL.
+072 - +077 Ignore these bytes.
K+078 - +107 For up to 30 categories on the MRL, the defined category that A
?appears in each position. Byte +078 is the leftmost column of C
Athe MRL, and has a value of 01H to 1EH that defines which of the A
?category names appears in this position. These numbers change 0
as a result of changing the layout of the MRL.
+108 - +113 Ignore these bytes.
M+114 - +143 1BI. For up to 30 categories on the SRL, the horizontal screen B
@position. These are changed as a result of changing the layout B
@of the SRL. AW makes sure that these entries, and the vertical B
@screen positions, are kept in order from left to right with top
to bottom.
+144 - +149 Ignore these bytes.
M+150 - +179 1BI. For up to 30 categories on the SRL, which of the category ?
=names appears in this position. These change as a result of >
<changing the SRL. This number refers to the category names
listed below.
+216 - +221 Ignore six bytes.
M+222 1BI. Number of categories on MRL. Will be less than, or equal =
;to the number of categories in the file. SRL displays all 7
categories, so there is no equivalent number for SRL.
I+223 - +224 1WI. For first line of RAC selection rules. Zero means no @
>selection rules. Any other value refers to the category name +
that is tested. MSB will always be zero.
J+225 - +226 1WI. Category name for second line of RAC selection rules. )
Zero means that there is only one line.
N+227 - +228 1WI. Category name for third line of RAC selection rules. Zero %
means that there is no third line..
L+229 - +230 1WI. For first line of RAC rules, which of the tests is to be ?
applied. 1 means "equals," 2 means "greater than" and so on.
+231 - +232 Test for second line of rules, if any.
+233 - +234 Test for third line, if any.
+235 - +236 1WI. Continuation code for first line: 1:And, 2:Or, 3:Through.
+237 - +238 1WI. Continuation code for second line.
N+239 - +240 1WI. Continuation code for third line. Not possible, so always
zero.
L+241 - +272 String, max length 30 bytes. Comparison information for first
line RAC selection rules.
+273 - +304 Comparison for 2nd line.
+305 - +336 Comparison for 3rd line.
+337 - +356 Ignore these six bytes.
N+357 - +378 Name of the first category. A string, maximum length 20 bytes. @
>If the file has only one category, the header record will end
here.
K+379 - +400 Name of the second category, if any. This area will not be on 2
the header record if there is only one category.
K+401 ... Additional 22 byte entries for all remaining categories. The B
@size of the header record depends on the number of categories. 1
Space is not maintained past the last category.
NReport Records follow the header record. One of the header record categories P
Ntells you how many report records to expect. The number will be from 0 to 8. 0
Each report record is 600 bytes, and contains:
+000 - +019 String (max 19) Report name.
K+020 - +052 Column width (1BI) for up to 33 columns a tables style report B
@format. Byte +020 is for the leftmost column on a tables style B
@report. There can be up to 30 categories from the file, plus 3
more calculated columns.
N For labels style report formats, the value is a 1BI that has the =
;horizontal position of this category, relative to the left
margin.
+053 - +055 Skip three bytes.
N+056 - +088 For tables style: Number of spaces to be printed at the right of
justified columns.
N For labels style: Vertical position on the report for each of up B
@to 30 categories. 1BI. A value of 1 means that category is on $
first line of labels style report.
+089 - +091 Skip 3 bytes.
M+092 - +124 For up to 33 columns of tables style: Values for 1 to 30D refer @
>to which category name appears in this column on the report. B
@Values of 80H, 81H and 82H are the three calculated categories,
from left to right.
J For labels style: Same as tables style, minus the calculated
categories.
+125 - +127 Skip the three columns.
N+128 - +160 For up to 33 columns of table style: 99H means no foot totals, 0 =
thru 4 means the number of decimal places for a foot total.
K For labels style: For up to 30 categories on report, boolean 2
whether or not category names are to be printed.
+161 - +163 Skip these three bytes.
N+164 - +196 For up to 33 columns of tables style: 99H means left justified, A
0H through 4H means right justified with 0 to 4 decimal places.
M For up to 30 categories of labels style: Boolean whether or not ?
=to float (OA-J) this category up against the category to its
left.
+197 - +199 Skip three bytes.
H+200 1BI. Number of categories on report. Includes calculated
categories, if any.
N+201 Tables style. If there is a least one calculated category, this A
?is a 1BI containing values from 1H to 33D: which column of the
report.
L Labels style: 1BI. Values from 3H to 21D. Position of line on 9
the screen that says "Each record will print nn lines."
G+202 Tables style: Same as +201, but for the second calculated
category, if any.
Labels style: Unused.
F+203 Tables style: Same as +201, but for the third calculated
category, if any.
Labels style: Unused.
H+204 Tables style only: If there is a group total column, a 1BI B
@stating which of the category names is used as a basis. Values
from 1D to 30D.
L+205 Platen width value, in 10ths of an inch. For example, a value <
of 8.0 inches entered by the user will show as 80D or 50H.
+206 Left margin value. All inches values are in 10ths.
+207 Right margin value.
+208 Characters per inch. 1BI.
+209 Paper length value. 10ths of an inch.
+210 Top margin value.
+211 Bottom margin value.
+212 Lines per inch. 6H or 8H. 1BI.
+213 Not relevant. Probably always a "C".
+214 Type of report format. H:tables style, V:labels style.
H+215 Spacing: S(ingle, D(ouble, or T(riple. Expect these three $
letters even in European versions.
+216 Print report header. Boolean.
M+217 Tables style: If user has specified group totals, Boolean: just
print the group totals.
K+218 Labels style: Boolean, omit line when all entries on line are
blank.
N+219 Labels style: Boolean, keep number of lines the same within each
record.
+220 - +301 80 byte string. Title line, if any.
F+302 - +323 Tables style. 20 byte string. Name of first calculated
category, if any.
I+324 - +355 Tables style. 30 byte string. Calculation rules for first
calculated category, if any.
M+356 - +409 Tables style. Name and rules for third calculated category, if
N+464 - +477 If user has specified "Send special codes to printer," this as a (
13 byte string containing those codes.
+478 Boolean: Print a dash when an entry is blank.
L+479 - +592 Record selection rules. Exact same format as described in the
header record.
+593 - +599 Unused.
LData records follow the report records. The first data record contains the L
Jstandard values. Each following data record corresponds to one data base
"record."
LThese records contain all of the categories within one stream of data. The O
Mcategory entries are in the same order that the category names appear in the
header record.
KBytes +0 and +1 are a Word that contains a count of the number of bytes in
the remainder of the record.
KByte +2 of each record will always be a control byte. Other control bytes N
within each record define the contents of the record. Control bytes may be:
K01 - 7FH This is a count of the number of following bytes that are the
contents of a category.
J81 - 9EH This (minus 80) is a count of the number of categories to be 7
skipped. For example, 82H means skip two categories.
FFH This indicates the end of the record.
NThe information in individual categories may have some special coding so that 1
date and time entries can be arranged (sorted).
Date entries will have the following format:
+000 C0H (192D). Identifies a date entry.
+001 - +002 ASCII year code, like 84.
+003 ASCII month code. A means January, L means December.
+004 - +005 ASCII day of the month.
Time entries will have the following format:
+000 D4H (212D). Identifies a time entry.
M+001 ASCII hour code. A means 00 (the hour after after midnight). X %
means 23, the hour before midnight.
+002 - +003 ASCII minute code. Values from 00 to 59.
This is the end of the data base file layouts.
Word Processor Files
KWord Processor files start with a 300 byte header, followed by a number of @
variable length line records, one for each line on the screen.
+000 - +003 Not used
+004 4FH is always here.
+005 - +084 Tab stops. Either = or |
+085 Zoom switch. Boolean.
+086 - +089 Four bytes not used.
M+090 Boolean, whether file is currently paginated, i.e., whether the
page break lines are showing.
L+091 Minimum left margin that should be added to the margin that is @
>appearing on the screen. This is normally one inch, shown in
10ths of an inch, 10 or 0AH.
N+092 - +249 Not used. More or less reserved for "mail merge" feature. (May
be used in version 2.0?)
F+250 - +299 Available. Will Never be used by AppleWorks. If you are B
@creating AW WP files, you can use this area to keep information $
that is important to your program.
LLine records are of three different types. The first line record after the M
K300 byte header corresponds to line 1, the next is line 2, and so on. The N
Lfirst two bytes of each line record contain enough information to establish
the type.
NCarriage return line records have a D0H in byte +001. Byte +000 is a one byte J
Hinteger between 0 and 79 that is the horizontal screen position of this
carriage return.
NCommand line records are formatting commands that appear on the screen in the M
Kform -------Double Space, for example. These can be identified by a value
greater than D0H in byte +001.
They are:(
Byte +001 Command Byte +000
D8H Platen width 10ths of an inch/
D9H Left margin 10ths of an inch/
DAH Right margin 10ths of an inch/
DBH Chars per inch One byte integer)
DCH Proportional-1 No meaning
DDH Proportional-2/
DEH Indent One byte integer
DFH Justify
E0H Unjustify
E1H Center/
E2H Paper length 10ths of an inch/
E3H Top margin 10ths of an inch/
E4H Bottom margin 10ths of an inch/
E5H Lines per inch One byte integer
E6H Single space
E7H Double space
E8H Triple space
E9H New page
EAH Group begin
EBH Group end
ECH Page header
ECH Page footer-
EEH Skip lines One byte count/
EFH Page number One byte integer
F0H Pause each page
F1H Pause here5
F2H Set marker One byte marker number9
F3H Page number One byte integer (add 256)3
F4H Page break One byte page number9
F5H Page break One byte integer (add 256)9
F6H Page break One byte integer (break in3
middle of paragraph)<
F7H Page break One byte integer (add 256, in3
middle of paragraph)
FFH End of file
Text records are the lines where text has been typed. The format is:
M+000 - +001 Word. Number of bytes following this word. Since the maximum is A
?about 80, byte +001 is always zero. Use byte +001 to identify
text lines.
J+002 Screen column for the first text character. Usually will be @
>zero, but may vary as a result of left margin, centering, and
indent commands.
J+003 80 bit: If on, there is a carriage return on the end of this $
line. If off, no carriage return.
Remaining 7 bits: Number of bytes of text following this byte.
I+004 - nnn Actual text bytes. Consists of Ascii characters and special <
:codes. The special codes are values from 01H to 1FH, and '
indicate special formatting features.
Code Meaning
01H Begin boldface
02H Boldface end
03H Superscript begin
04H Superscript end
05H Subscript begin
06H Subscript end
07H Underline begin
08H Underline end
09H Print page number
0AH Enter keyboard
0BH Sticky space
This is the end of the word processor file layout.
Spreadsheet files
JSpreadsheet files start with a 300 byte header record that contains basic O
Minformation about the file, including column widths, printer options, window #
definitions, and standard values.
+000 - +003 Skip 4 bytes.
+004 - +130 1BI containing the column width for each column.
+131 Order of recalculation. ASCII R or C.
+132 Frequency of recalculation. ASCII A or M.
+133 - +134 Last row referenced. Word.
+135 Last column referenced. 1BI.
J+136 Number of windows: ASCII 1: just one window, S: side by side %
windows, T: top and bottom windows.
+137 Boolean. If there are two windows, are they synchronized?
L+138 - +161 The next 20 (approx) variables are for the current window. If @
>there is only one window, it is the current window. If there A
?are two windows, the current window is the window that had the
cursor in it.
N+138 Window standard format for label cells. 2H: left justified, 3H:
right justified, 4H: centered.
N+139 Window standard format for value cells. 2H: fixed, 3H: dollars, +
4H: commas, 5H: percent, 6H: appropriate.
M+140 Top screen line used by this window. This is the line that the A
?=====A=========B==== appears on. Normally 1H unless there are
top and bottom windows.
M+142 Leftmost screen column used by this window. This is the column B
@that the hundreds digit of the row number appears in. Normally +
0H unless there are side by side windows.
N+143 - +144 Top, or first, row appearing in titles area. This will probably '
be zero if there are no "top" titles.
M+145 Leftmost, or first, column appearing in left side titles area. >
This will probably be zero if there are no left side titles.
K+146 - +147 Last row appearing in top titles area. This will probably be "
zero if there are no top titles.
H+148 Last column appearing in left side titles area. This will 4
probably be zero if there are no left side titles.
J+149 - +150 Top, or first, row appearing in the body of the window. The C
Abody is defined as those rows that are on the screen, but not in
the titles area.
+151 Leftmost, or first, column appearing in the body of the window.
I+152 The screen line that the top body row goes on. Normally 2H 9
unless there are top titles, or top and bottom windows.
H+153 Leftmost screen column used for the leftmost body column. <
:Normally 4H unless there are side titles, or side by side
windows.
+154 - +155 Bottommost, or last, row appearing in this window.
+156 Rightmost, or last, column appearing in this window.
K+157 The screen line that the last body row goes on. Normally 13H 0
(19D) unless there are top and bottom windows.
L+158 The rightmost screen column used by this window. Normally 4EH .
(78D) unless there are side by side windows.
M+159 1BI. Number of horizontal screen locations used to display the <
:body columns. Normally 48H (72D), because 8 columns of 9 A
?characters each are the standard display. This is affected by @
side by side windows, side titles, and variable column widths.
J+160 Boolean. Rightmost column is not fully displayed. This can C
Aonly happen when the body portion of the window is narrower than #
the width of a particular column.
N+162 - +185 Window information for the secondary window. This is meaningful B
@only if there are two windows. This is the information for the 7
5window that the cursor is not currently in. See the 4
descriptions for the current window (+138 - +161).
+186 - +212 Not currently used.
+213 Boolean, cell protection is on or off.
+214 Not currently used.
L+215 Platen width value, in 10ths of an inch. For example, a value <
of 8.0 inches entered by the user will show as 80D or 50H.
+216 Left margin value. All inches values are in 10ths.
+217 Right margin value.
+218 Characters per inch. 1BI.
+219 Paper length value. 10ths of an inch.
+220 Top margin value.
+221 Bottom margin value.
+222 Lines per inch. 6H of 8H. 1BI.
H+223 Spacing: S(ingle, D(ouble, or T(riple. Expect these three %
letters, even in European versions.
N+224 - +237 If user has specified "Send special codes to printer," this is a (
13 byte string containing those codes.
+238 Boolean: Print a dash when an entry is blank.
+239 Print report header. Boolean.
+240 Boolean. Zoomed in to show formulas.
+241 - +249 Reserved for future use.
G+250 - +299 Available. Will Never be used by AppleWorks. If you are B
@creating AW SS files, you can use this area to keep information $
that is important to your program.
LRow records contain a variable amount of information about each row that is N
Lnon-blank. Each row record contains enough information to completely build
one row of the spreadsheet:
+000 - +001 Number of additional bytes to read from disk.
+002 - +003 Word. Row number.
M+004 Beginning of actual information for the row. This byte of each =
;record will always be a control byte. Other control bytes A
?within each record define the contents of the record. Control C
Abytes may be 01-7FH. This is a count of the number of following .
bytes that are the contents of a cell entry.
M 81-9EH. This (minus 80) is a count of the number of columns to 7
be skipped. For example, 82H means skip two columns.
FFH. This indicates the end of the row.
NCell entries contain all the information that is necessary to build one cell.
There are several types:
LValue constants are cells that have a value that cannot change. This means D
that someone typed a constant into the cell, 3.14159, for example.
+000 Bit 80 is always on.
H Bit 40 on means that if the value is zero, display a blank A
?instead of a zero. This is for pre-formatted cells that still
have no value.
Bit 20 is always on.
Bit 10 on means that labels cannot be typed into this cell.
Bit 08 on means that values cannot be typed into this cell.
Bits 04, 02, and 01 specify the formatting for this cell:
1: Use spreadsheet standard
2: Fixed
3: Dollars
4: Commas
5: Percent
6: Appropriate
+001 Bit 80: always zero.
Bit 40: always zero.
Bit 20: always zero.
K Bits 04, 2, 01. Number of decimal places for fixed, dollars,
commas, or percent formats.
+002 Not used.
+003 - +010 8 byte Apple SANE numerics double format floating point number.
MValue formulas are cells that contain information that has to be evaluated. O
formulas like AA17+@sum(r19..r21), and @Error are examples. Specific format:
+000 Bit 80 is always on.
H Bit 40 on means that if the value is zero, display a blank A
?instead of a zero. This is for pre-formatted cells that still
have no value.
Bit 20 is always off.
Bits 10, 08, 04, 02, and 01 are the same as value constants.
+001 Bit 80: always on.
K bit 40: On indicates that the last evaluation of this formula
resulted in an @NA.
K Bit 20: On indicates that the last evaluation of this formula
resulted in an @Error.
Bits 04, 02, 01 same as value constants.
N+002 - +009 8 byte SANE double floating point number that is the most recent
evaluation of this cell.
N+010 - nnn Various control bytes that are "tokens" representing the formula )
that was typed in by the user they are:
Byte Means
DCH @Sum
DDH @Avg
DEH @Choose
DFH @Count-
E0H @Error (followed by 3 bytes of zero)!
E1H Reserved for future @IRR
E2H @If
E3H @Int
E4H @Lookup
E5H @Max
E6H @Min.
E7H @NA (followed by three bytes of zero)
E8H @NPV
E9H @Sqrt
EAH @Abs
EBH Not currently used
ECH <> (not equal)&
EDH >= (greater than or equal to)#
EEH <= (less than or equal to)
EFH = (equals)
F0H > (greater than)
F1H < (less than)
F2H , (comma)
F3H ^ (exponentiation sign)
F4H ) (right parenthesis)
F5H - (minus)
F6H + (plus)
F7H / (divide)
F8H * (multiply)
F9H ( (left parenthesis)!
FAH - (unary minus. Ex: -A3)
FBH + (unary plus. Ex: +A3)
FCH ... (dots),
FDH Next 8 bytes are SANE double number0
FEH Next 3 bytes are row, column reference.
KTwo of the codes require special information. Code FDH indicates that the M
Knext 8 bytes are a SANE numerics package "double" precision floating point B
number. All constants with formulas are carried in this manner.
Code FEH indicates that the next three bytes point at a cell:
+000 FEH
I+001 Column reference. Add this 1BI to the column number of the A
?current cell to get the column number of the pointed at cell. 9
This value is sometimes negative, but Add always works.
K+002 - +003 Row reference. Word. Add this word to the row number of the ?
=current cell to the row number of the pointed at cell. This 4
value is sometimes negative, but Add always works.
LPropagated label cells are labels that place one particular ASCII character 7
in each position of a window. Handy for underlining.
+000 Bit 80 is always zero.
Bit 40 is meaningless.
Bit 20 is always on.
Bit 10 and bit 08 are protection, just like value cells.
Bits 04, 02, 01 are meaningless. Put a 1 here.
M+001 This is the actual character that is to be put in each position
in the cell.
MRegular label cells contain alphanumeric information, such as heading, names K
and other descriptive information that is not the basis for calculations.
+000 Bits 80, 40, 20 are always zero.
Bits 10 and 08 are same as value cells.
Bits 04, 02, and 01 determine cell formatting:
01: Use spreadsheet standard formatting
02: Left justify
03: Right justify
04: Center
L+001 - +nnn ASCII characters that actually display. The actual length was C
Adefined earlier in the word that contained the "actual number of
bytes to read from disk."
This is the end of the spreadsheet file format.
This is the end of AppleWorks file formats.